const router = require('koa-router')();
const user = require('../modules/user');

//获取数据
router.get('/',async (ctx,next) => {
    ctx.body = await user.selectUsers();  
})
//增加数据
router.post('/',async (ctx,next) => {
    ctx.body = await user.addUsers(ctx.request.body)
})
//删除数据
router.delete('/:user_number',async (ctx,next) => {
    ctx.body = await user.deleteUsers(ctx.params);
})
//修改数据
router.put('/',async (ctx,next) => {
    ctx.body = await user.putUsers(ctx.request.body)
})

module.exports = router;